package helloworld.admin.assembler.news;

import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;
import helloworld.admin.bean.NewsAdminBean;
import helloworld.admin.form.news.NewsForm;

public class NewsDetailAssembler
{
	private NewsDetailAssembler() { }

	public static final NewsAdminBean createNewsDetail(NewsForm form)
	{
		NewsAdminBean news = new NewsAdminBean();
		try
		{
			BeanUtils.copyProperties(news, form);
			//BeanUtils.copyProperties(news.getAddress(), form.getAddress());
		}
		catch (InvocationTargetException ite)
		{
			ite.printStackTrace();	//do nothing for now
		}
		catch (IllegalAccessException iae)
		{
			iae.printStackTrace();	//do nothing for now
		}
		return news;		
	}

}